package com.rf.richfitwheel.admin.utils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

public class MapCaseUtil {
    /**
     * 将list中的map的所有key转成小写
     * @param list
     * @return
     */
    public static List<Map<String, Object>> mapKeyToLowerCase(List<Map<String, Object>> list) {
        return list.stream().map(m -> {
            Map<String, Object> rm = new HashMap<>();
            Set<String> keySet = m.keySet();
            for(String key : keySet){
                rm.put(key.toLowerCase(), m.get(key));
            }
            return rm;
        }).collect(Collectors.toList());
    }
}
